package com.msh.automatic.android.api.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;

/**
 * 任务执行记录;
 * @author : http://www.chiner.pro
 * @date : 2025-6-7
 */
@Data
@TableName("task_log")
@ApiModel(value = "任务执行记录",description = "")
public class TaskLog implements Serializable,Cloneable{
    /** 主键 */
    @TableId
    @TableField(value = "`id`")
    @ApiModelProperty(name = "id",notes = "主键")
    private String id;

    /** 任务id */
    @TableField(value = "`task_id`")
    @ApiModelProperty(name = "taskId",notes = "任务id")
    private String taskId;

    /** 任务状态 */
    @TableField(value = "`status`")
    @ApiModelProperty(name = "status",notes = "任务状态")
    private TaskLogStatus status;

    /** 任务消息 */
    @TableField(value = "`message`")
    @ApiModelProperty(name = "message",notes = "任务消息")
    private String message;

    /** 设备id */
    @TableField(value = "`device_id`")
    @ApiModelProperty(name = "deviceId",notes = "设备id")
    private String deviceId;

    /** 乐观锁 */
    @com.baomidou.mybatisplus.annotation.Version
    @ApiModelProperty(name = "revision",notes = "乐观锁")
    private Integer revision;

    /** 创建人 */
    @TableField(value = "`created_by`",fill = FieldFill.INSERT)
    @ApiModelProperty(name = "createdBy",notes = "创建人")
    private String createdBy;

    /** 创建时间 */
    @TableField(value = "`created_time`",fill = FieldFill.INSERT)
    @ApiModelProperty(name = "createdTime",notes = "创建时间")
    private Date createdTime;

    /** 更新人 */
    @TableField(value = "`updated_by`",fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(name = "updatedBy",notes = "更新人")
    private String updatedBy;

    /** 更新时间 */
    @TableField(value = "`updated_time`",fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(name = "updatedTime",notes = "更新时间")
    private Date updatedTime;

    /** 数据权限 */
    @TableField(value = "`data_permissions`")
    @ApiModelProperty(name = "dataPermissions",notes = "数据权限")
    private String dataPermissions;

    /** 数据版本 */
    @TableField(value = "`data_version`")
    @ApiModelProperty(name = "dataVersion",notes = "数据版本")
    private Integer dataVersion;


    /** 任务状态枚举 */
    public enum TaskLogStatus{
        wait_push,
        push_success,
        wait_execute,
        execute,
        over,
    }


}